<html>
<head>
<#assign basePath=request.contextPath>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>后台管理系统</title>
    <link href="${basePath}/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/font-awesome.min.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/form.lzy.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/good.lzy.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css"
          rel="stylesheet">
    <style>
        .contract-group {padding:0 20px 20px; }
        .contract-title {font-size: 18px;text-align: center;}
        .contract-content {border:1px solid #ccc; min-height: 200px;}
        .contract-signature {border:1px solid #ccc; width:500px;}
        .contract-signature img {width: 100%;}
        #reason {display: none;}
    </style>
</head>
<body>

<div id="page-wrapper">
    <div class="panel panel-f5">
        <div class="panel-body row">

            <#--<h1>● 基础信息</h1>-->
            <form id="Form" class="form-horizontal" method="post">
                <input type="hidden" name="memberId" value="${dto.memberId?c}" />
                <input type="hidden" name="orderId" value="${dto.orderId?c}" />
                <div class="contract-group">
                    <div class="contract-title">${dto.contractName!}</div>
                    <div class="contract-content">
                        <a class="media" href="${dto.contractUrl!}">暂时无法查看，请点击下载</a>
                    </div>
                </div>
                <div class="contract-group">
                    <span class="detail-span">姓名:${dto.name!}</span> &nbsp;&nbsp;&nbsp;
                    <span class="detail-span">身份证:${dto.idCard!}</span>
                </div>
                <div class="contract-group">
                    <span class="detail-span">签名:</span>
                    <div class="contract-signature">
                        <img src="${dto.signedPhoto!}">
                    </div>
                </div>
                <div class="form-group">
                    <span class="control-label col-sm-4 col-xs-4"></span>
                    <div class="col-sm-8 col-xs-8">
                        <button type="button" class="btn btn-info" onclick="goBack();"><i class="fa fa-close"></i>返回
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>


<script src="${basePath}/bootstrap/js/jquery.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/plugin/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript"
        src="https://cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/bootstrap-validator/0.5.3/js/language/zh_CN.js"></script>
<script type="text/javascript">
    $(window).bootstrapValidator || document.write('<script src="${basePath}/bootstrap/js/bootstrapValidator.min.js"><\/script>' +
            '<script src="${basePath}/bootstrap/js/bootstrapValidator-zh_CN.js"><\/script>');
</script>
<script src="${basePath}/bootstrap/js/common.js" type="text/javascript"></script>
<script type="text/javascript"
        src="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
        src="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${basePath}/bootstrap/js/campsite.js" type="text/javascript"></script>

<script>
    $('.agree-radio').change(function(){
        var val = $('input[name=contractVerify]:checked').val();
        if(val ==1 ){
            $('#reason').hide();
        }else if(val == 2 ){
            $('#reason').show();
        }
    });
    var index = parent.layer.getFrameIndex(window.name);
    function goBack() {
        parent.layer.close(index);
        //window.location.href = "${basePath}/admin/coupons/member/contractList/${(dto.memberId)?c}";
    }

    function submitForm() {
        var bsVal = $("#Form").data('bootstrapValidator');
        bsVal.validate();
        if (bsVal.isValid()) {
            $.ajax({
                type: 'POST',
                dataType: 'json',
                url: '${basePath}/admin/coupons/member/verify',
                data: $("#Form").serialize(),
                success: function (data) {
                    if (data.code == '0') {
                        layer.alert('操作成功', {
                            icon: 1
                        }, function () {
                            window.location.href = '${basePath}/admin/coupons/member/contractList/${memberId?c}';
                        })
                    } else {
                        layer.alert(data.desc, {
                            icon: 5
                        });
                    }
                },
                error: function () {
                    layer.alert('系统错误', {
                        icon: 5
                    });
                }
            });

        }
        else {
//            var smallTop = $("small:visible").eq(0).offset().top - 50;
//            $("html,body").animate({scrollTop: smallTop}, 300);
        }
    }

    //表单验证
    $('#Form').bootstrapValidator({
        fields: {
            reason: {
                validators: {
                    notEmpty: {
                        message: '请输入原因'
                    }
                }
            }
        }
    });
</script>
</body>
</html>
